<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <ui:composition template="structpage/templates/defaultLayout.xhtml">
            <ui:define name="title">
                    <h:outputText value="ChequeTeatinos" />
        </ui:define>
        <ui:define name="content">
            <h2><h:outputText value="#{msg.register}"/></h2>
            <h:panelGroup layout="block">
                <h:form>
                    <h:panelGroup layout="block" styleClass="form_settings">
                        <p>
                            
                            <h:panelGroup><p:outputLabel value="#{msg.email}"/></h:panelGroup><br/>
                            <p:inputText id="E-mail" label="E-mail" value="#{loginBean.email}" required="true">
                                <f:validator binding="#{signupValidationBean}"/>
                                <f:ajax event="blur" render="EmailValidationMessage" />   
                            </p:inputText>
                        </p>
                        <p>
                            <h:panelGroup><p:outputLabel value="#{msg.password}"/></h:panelGroup><br/>
                            <p:password id="Password" label="Password" value="#{loginBean.password}" required="true" validatorMessage="Campo requerido">
                                <f:ajax event="blur" render="PasswordValidation" />   
                            </p:password>
                        </p>
                        <p>
                            <h:panelGroup><p:outputLabel value="#{msg.passagain}"/></h:panelGroup><br/>
                            <p:password id="Password2" label="Password2" value="#{loginBean.password2}"/>
                        </p>
                        <p>
                            <h:panelGroup><p:outputLabel value="#{msg.name}"/></h:panelGroup><br/>
                            <p:inputText id="Nombre" label="Nombre" value="#{loginBean.nombre}" required="true" validatorMessage="Campo requerido">
                                <f:ajax event="blur" render="NombreValidation" />   
                            </p:inputText>
                        </p>
                            
                        <p>
                            <h:panelGroup><p:outputLabel value="#{msg.surname}"/></h:panelGroup><br/>
                            <p:inputText id="Apellidos" label="Apellidos" value="#{loginBean.apellidos}"/>
                        </p>
                            
                        <p>
                            <h:panelGroup><p:outputLabel value="#{msg.tlf}"/></h:panelGroup><br/>
                            <p:inputText id="Telefono" label="Telefono" value="#{loginBean.numero}" required="true" validatorMessage="Campo requerido">
                                <f:ajax event="blur" render="TelefonoValidation" />   
                            </p:inputText>
                        </p>
                        <h:commandButton value="#{msg.signup}" action="#{loginBean.doSignup()}" styleClass="submit"/>
                    </h:panelGroup>
                    <p>
                        <span><h:outputLabel value="#{loginBean.error}" styleClass="error"/></span>
                    </p>
                    <p>
                        <span><h:message for="E-mail" styleClass="error" id="EmailValidationMessage"/></span>
                    </p>
                    <p>
                        <span><h:message for="Password" styleClass="error" id="PasswordValidation"/></span>
                    </p>
                    <p>
                        <span><h:message for="Nombre" styleClass="error" id="NombreValidation"/></span>
                    </p>
                    <p>
                        <span><h:message for="Telefono" styleClass="error" id="TelefonoValidation"/></span>
                    </p>
                </h:form>
            </h:panelGroup>
        </ui:define>
    </ui:composition>
</html>